<?php
/**
 * Template Name:create_yangsheng
 * 
 * 生成养生栏目静态页面
 * 
 * 养生：
 * 2：季节养生
 * 3：杂谈养生
 * 4：饮食养生
 * 5：中医养生
 */

$smarty = smarty_get_instance();

//养生分类ID
$yang_catid = 6;

//第一行第一列_幻灯片
$first_first = catid_article(127,$yang_catid,3);

//第一行第二列
$first_second = catid_article(128,$yang_catid,8);

//第一行第三列
$first_third = catid_article(129,$yang_catid,4);

//第二行：春夏秋冬养生分类导航第一列：
$second_first = subcatid(139, $yang_catid,1,2);

//第二行：春夏秋冬养生分类导航第一列：
$second_second = subcatid(139, $yang_catid,3,2);

//第二行：春夏秋冬养生分类导航第一列：
$second_third = subcatid(139, $yang_catid,4,2);

//第三行第一列左部分:杂谈养生
$third_first = subcatid(140, $yang_catid,4,3);

//第三行第一列右部分上面:杂谈养生
$third_first_right_top = subcatid(141, $yang_catid,1,3);

//第三行第一列右部分下面__左边:杂谈养生
$third_first_right_buttom_left = subcatid(142, $yang_catid,8,3);

//第三行第一列右部分下面__右边:杂谈养生
$third_first_right_buttom_right = subcatid(142, $yang_catid,3,3);

//第三行第二列:养生小贴士
$third_second= catid_article(143,$yang_catid,3);


//第四行第一列上部分：饮食养生
$forth_first_top = subcatid(144,$yang_catid,3,4);

//第四行第一列 下部分，第一个：饮食养生
$forth_first_buttom_first = subcatid(142,$yang_catid,1,4);

//第四行第一列 下部分，第二个：饮食养生
$forth_first_buttom_second = subcatid(142,$yang_catid,4,4);

//第四行第一列 下部分，第三个：饮食养生
$forth_first_buttom_third = subcatid(142,$yang_catid,8,4);

//第四行第一列 下部分，第 四个：饮食养生
$forth_first_buttom_forth = subcatid(142,$yang_catid,3,4);

//第四行第二列：热门养生
$forth_second= catid_article(143,$yang_catid,10);

//第五行第一列上部
$fifth_first_top= catid_article(147,$yang_catid,8);

//第五行第二列上部：最新养生
$fifth_second_top= catid_article(145,$yang_catid,3);

//第五行第二列下部：最新养生
$fifth_second_buttom= catid_article(146,$yang_catid,1);

//第五行第三列上部:中医养生
$fifth_third_top= subcatid(145,$yang_catid,3,5);

//第五行第三列下部:中医养生
$fifth_third_buttom= subcatid(146,$yang_catid,1,5);

$smarty->assign("first_first",$first_first);
$smarty->assign("first_second",$first_second);
$smarty->assign("first_third",$first_third);

$smarty->assign("second_first",$second_first);
$smarty->assign("second_second",$second_second);
$smarty->assign("second_third",$second_third);

$smarty->assign("third_first",$third_first);
$smarty->assign("third_first_right_top",$third_first_right_top);
$smarty->assign("third_first_right_buttom_left",$third_first_right_buttom_left);
$smarty->assign("third_first_right_buttom_right",$third_first_right_buttom_right);
$smarty->assign("third_second",$third_second);

$smarty->assign("forth_first_top",$forth_first_top);
$smarty->assign("forth_first_buttom_first",$forth_first_buttom_first);
$smarty->assign("forth_first_buttom_second",$forth_first_buttom_second);
$smarty->assign("forth_first_buttom_third",$forth_first_buttom_third);
$smarty->assign("forth_first_buttom_forth",$forth_first_buttom_forth);
$smarty->assign("forth_second",$forth_second);

$smarty->assign("fifth_first_top",$fifth_first_top);
$smarty->assign("fifth_second_top",$fifth_second_top);
$smarty->assign("fifth_second_buttom",$fifth_second_buttom);
$smarty->assign("fifth_third_top",$fifth_third_top);
$smarty->assign("fifth_third_buttom",$fifth_third_buttom);

$content = $smarty->fetch("yangsheng.tpl");
$fp = fopen( "/home/admin/tueye/wordpress/wp-content/themes/tueye/yangsheng.html", "w" );
fwrite($fp,$content);
fclose($fp);
?>